package com.server.limit;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @title: LimitStrategyFactory
 * @author: gyuan
 * @description
 * @date: 2023-11-10 10:19
 */
public class LimitStrategyFactory {

    private static final Map<String,ILimitManager> LIMIT_MANAGER = new ConcurrentHashMap<>();

    public static void register(String strategyName, ILimitManager limitManager) {
        LIMIT_MANAGER.put(strategyName, limitManager);
    }

    public static ILimitManager get(String strategyName) {
        return LIMIT_MANAGER.get(strategyName);
    }

}
